(function(){"use strict";BX.addCustomEvent(window,"BX.Landing.Block:init",function(r){e(r);n(r);a(r);t(r);l(r)});BX.addCustomEvent("BX.Landing.Block:Node:update",BX.debounce(a,200));BX.addCustomEvent("BX.Landing.Block:Cards:update",function(e){a(e)});BX.addCustomEvent("BX.Landing.Block:Card:add",function(e){a(e)});BX.addCustomEvent("BX.Landing.Block:Card:remove",function(e){a(e)});function e(e){var n=e.makeRelativeSelector(".u-header");if(e.block.querySelectorAll(n).length>0){if(BX.Landing.getMode()==="view"){$.HSCore.components.HSHeader.init($(n))}}}function n(e){var n=e.makeRelativeSelector(".js-scroll-nav");if(e.block.querySelectorAll(n).length>0){$.HSCore.components.HSScrollNav.init($(n),{duration:400,easing:"easeOutExpo"})}}function a(e){var n=e.makeRelativeSelector(".navbar-nav");if(e.block.querySelectorAll(n).length>0){c(n);r(n)}}function t(e){var n=e.block.querySelector(e.makeRelativeSelector(".navbar.u-navbar-modal"));if(n&&BX.Landing.getMode()=="edit"){BX.adjust(n,{children:[BX.create("div",{props:{className:"u-navbar-modal-alert"},html:BX.message("LANDING_NAVBAR_MODAL_ALERT")})]})}}function l(e){if(BX.Landing.getMode()!=="edit"){var n=e.block.querySelector(".g-menu-multilevel");if(n){d(n)}}}function r(e){if(BX.Landing.getMode()=="edit"){if(!i(e)){s(document.querySelector(e).querySelector(".nav-item"))}}else{o(e)}}function i(e){var n=false;var a=landingParams["LANDING_ID"];if(a===undefined||a===null){return false}var t=document.querySelector(e);var l=[].slice.call(t.getElementsByTagName("a"));if(!!l&&l.length){var r=new RegExp("#landing([0-9]+)");l.forEach(function(e){var t=e.href.match(r);if(t!==null&&t[1]==a){s(BX.findParent(e,{className:"nav-item"}));n=true}})}return n}function o(e){var n=false;var a=document.location;var t=document.querySelector(e);var l=[].slice.call(t.getElementsByTagName("a"));if(!!l&&l.length){l.forEach(function(e){if(e.hasAttribute("href")&&e.getAttribute("href")!==""&&e.pathname===a.pathname&&e.hostname===a.hostname&&e.hash===""){var t=BX.findParent(e,{className:"nav-item"});s(t);n=true}})}return n}function s(e){e.classList.add("active");BX.adjust(e,{children:[BX.create("span",{props:{className:"sr-only"},text:"(current)"})]})}function c(e){var n=document.querySelector(e);var a=[].slice.call(n.querySelectorAll(".nav-item"));if(!!a&&a.length){a.forEach(function(e){u(e)})}}function u(e){e.classList.remove("active");BX.remove(e.querySelector("span.sr-only"))}function d(e){var n=[].slice.call(e.querySelectorAll(".g-menu-sublevel"));n.forEach(function(e){var n=BX.findPreviousSibling(e,{class:"nav-link"});if(!n){return}f(n);if(e.querySelector(".nav-item.active")){m(n)}BX.addClass(n,"g-menu-sublevel-toggler--parent");BX.adjust(n,{children:[BX.create("span",{props:{className:"g-menu-sublevel-toggler"},html:'<span class="is-hide-text">'+BX.message("LANDING_NAVBAR_TOGGLER_SHOW")+'</span><span class="is-show-text">'+BX.message("LANDING_NAVBAR_TOGGLER_HIDE")+"</span>",events:{click:function(e){e.preventDefault();e.stopPropagation();v(BX.findParent(e.target,{class:"nav-link"}))}}})]})})}function v(e){if(BX.hasClass(e,"g-menu-sublevel-toggler--parent-hide")){m(e)}else{f(e)}}function f(e){BX.addClass(e,"g-menu-sublevel-toggler--parent-hide");var n=BX.findNextSibling(e,{class:"g-menu-sublevel"});if(n){BX.addClass(n,"g-menu-sublevel--hide")}}function m(e){BX.removeClass(e,"g-menu-sublevel-toggler--parent-hide");var n=BX.findNextSibling(e,{class:"g-menu-sublevel"});if(n){BX.removeClass(n,"g-menu-sublevel--hide")}}})();
//# sourceMappingURL=header_menu_init.map.js